package com.tongyi.modules.mld.controller.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

@Getter
@AllArgsConstructor
public enum StatusEnum {

    init("未处理", 0),
    claimed("已认领", 1),
    processed("已处理", 2),
    cancel("已取消", 3);

    private String desc;

    private int code;

    public static boolean checkStatus(String preName, String postName) {
        if (StringUtils.isBlank(postName) || StringUtils.isBlank(preName)) {
            return false;
        }
        if (StatusEnum.valueOf(preName).getCode() < StatusEnum.valueOf(postName).getCode()) {
            return false;
        }
        return true;
    }
}
